package com.apkfuns.logutils.parser;

import com.apkfuns.logutils.Parser;
import com.apkfuns.logutils.utils.ObjectUtil;
import ohos.eventhandler.InnerEvent;

/**
 * Created by pengwei on 2017/3/29.
 */

class InnerEventParse implements Parser<InnerEvent> {
    @Override
    public Class<InnerEvent> parseClassType() {
        return InnerEvent.class;
    }

    @Override
    public String parseString(InnerEvent event) {
        return event.getClass().getName() + " [" + LINE_SEPARATOR +
                String.format("%s = %s", "what", event.eventId) + LINE_SEPARATOR +
                String.format("%s = %s", "arg1", event.param) + LINE_SEPARATOR +
                String.format("%s = %s", "obj", ObjectUtil.objectToString(event.object)) + LINE_SEPARATOR +
                "]";
    }
}
